<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
  <title>Description of tt_qshiftstack_r</title>
  <meta name="keywords" content="tt_qshiftstack_r">
  <meta name="description" content="returns a stack R of non-periodic shift matrices">
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta name="generator" content="m2html v1.5 &copy; 2003-2005 Guillaume Flandin">
  <meta name="robots" content="index, follow">
  <link type="text/css" rel="stylesheet" href="../../m2html.css">
</head>
<body>
<a name="_top"></a>
<div><a href="../../index.html">Home</a> &gt;  <a href="#">tt2</a> &gt; <a href="index.html">core</a> &gt; tt_qshiftstack_r.m</div>

<!--<table width="100%"><tr><td align="left"><a href="../../index.html"><img alt="<" border="0" src="../../left.png">&nbsp;Master index</a></td>
<td align="right"><a href="index.html">Index for tt2/core&nbsp;<img alt=">" border="0" src="../../right.png"></a></td></tr></table>-->

<h1>tt_qshiftstack_r
</h1>

<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="box"><strong>returns a stack R of non-periodic shift matrices</strong></div>

<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="box"><strong>function [tt]=tt_qshiftstack_r(d) </strong></div>

<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="fragment"><pre class="comment"> returns a stack R of non-periodic shift matrices
 in the QTT format

 The size of the shift matrices matrices is N x N
 and the output is an N x N x N-tensor,
 where N=2^d(1) x ... x 2^d(end) 

 April 20, 2011
 Vladimir Kazeev
 vladimir.kazeev@gmail.com
 INM RAS
 Moscow, Russia

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 For details please see the preprint
 http://www.mis.mpg.de/publications/preprints/2011/prepr2011-36.html
 Vladimir A. Kazeev, Boris N. Khoromskij and Eugene E. Tyrtyshnikov
 Multilevel Toeplitz matrices generated by QTT tensor-structured vectors and convolution with logarithmic complexity
 January 12, 2012
 Vladimir Kazeev,
 Seminar for Applied Mathematics, ETH Zurich
 vladimir.kazeev@sam.math.ethz.ch
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</pre></div>

<!-- crossreference -->
<h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
This function calls:
<ul style="list-style-image:url(../../matlabicon.gif)">
<li><a href="../../tt2/@tt_tensor/reshape.html" class="code" title="function [tt2]=reshape(tt1,sz,eps, rl, rr)">reshape</a>	Reshape of the TT-tensor</li><li><a href="tt_reverse.html" class="code" title="function [tt2]=tt_reverse(tt,phd)">tt_reverse</a>	Returns a reversed TT representation</li></ul>
This function is called by:
<ul style="list-style-image:url(../../matlabicon.gif)">
<li><a href="tt_qutrtoepl.html" class="code" title="function [tt]=tt_qltrtoepl(x)">tt_qutrtoepl</a>	returns the multilevel upper-triangular Toeplitz matrix tt generated by the multi-dimensional input vector x</li></ul>
<!-- crossreference -->



<h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function [tt]=tt_qshiftstack_r(d)</a>
0002 
0003 <span class="comment">% returns a stack R of non-periodic shift matrices</span>
0004 <span class="comment">% in the QTT format</span>
0005 <span class="comment">%</span>
0006 <span class="comment">% The size of the shift matrices matrices is N x N</span>
0007 <span class="comment">% and the output is an N x N x N-tensor,</span>
0008 <span class="comment">% where N=2^d(1) x ... x 2^d(end)</span>
0009 <span class="comment">%</span>
0010 <span class="comment">% April 20, 2011</span>
0011 <span class="comment">% Vladimir Kazeev</span>
0012 <span class="comment">% vladimir.kazeev@gmail.com</span>
0013 <span class="comment">% INM RAS</span>
0014 <span class="comment">% Moscow, Russia</span>
0015 <span class="comment">%</span>
0016 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</span>
0017 <span class="comment">% For details please see the preprint</span>
0018 <span class="comment">% http://www.mis.mpg.de/publications/preprints/2011/prepr2011-36.html</span>
0019 <span class="comment">% Vladimir A. Kazeev, Boris N. Khoromskij and Eugene E. Tyrtyshnikov</span>
0020 <span class="comment">% Multilevel Toeplitz matrices generated by QTT tensor-structured vectors and convolution with logarithmic complexity</span>
0021 <span class="comment">% January 12, 2012</span>
0022 <span class="comment">% Vladimir Kazeev,</span>
0023 <span class="comment">% Seminar for Applied Mathematics, ETH Zurich</span>
0024 <span class="comment">% vladimir.kazeev@sam.math.ethz.ch</span>
0025 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</span>
0026 
0027 I=eye(2);
0028 J=[0,1;0,0];
0029 O=zeros(2);
0030 
0031 D=numel(d);
0032 tt=cell(sum(d),1);
0033 ind=0;
0034 <span class="keyword">for</span> K=1:D
0035     tt{ind+1}(:,:,1)=[O,J];
0036     tt{ind+1}(:,:,2)=[J,I];
0037     tt{ind+1}=permute(<a href="../../tt2/@tt_tensor/reshape.html" class="code" title="function [tt2]=reshape(tt1,sz,eps, rl, rr)">reshape</a>(tt{ind+1},[2,2,2,2]),[1,2,4,3]);
0038     tt{ind+1}=permute(tt{ind+1},[1,2,3,5,4]);
0039     
0040     <span class="keyword">for</span> k=2:d(K)-1
0041         tt{ind+k}(:,:,1)=[I,J';O,J];
0042         tt{ind+k}(:,:,2)=[J',O;J,I];
0043         tt{ind+k}=permute(<a href="../../tt2/@tt_tensor/reshape.html" class="code" title="function [tt2]=reshape(tt1,sz,eps, rl, rr)">reshape</a>(tt{ind+k},[2,2,2,2,2]),[1,3,5,2,4]);
0044     <span class="keyword">end</span>
0045 
0046     tt{ind+d(K)}(:,:,1)=[I;O];
0047     tt{ind+d(K)}(:,:,2)=[J';J];
0048     tt{ind+d(K)}=permute(<a href="../../tt2/@tt_tensor/reshape.html" class="code" title="function [tt2]=reshape(tt1,sz,eps, rl, rr)">reshape</a>(tt{ind+d(K)},[2,2,2,2]),[1,3,4,2]);
0049     
0050     ind=ind+d(K);
0051 <span class="keyword">end</span>
0052 
0053 tt{1}=permute(tt{1},[1,2,3,5,4]);
0054 
0055 tt=<a href="tt_reverse.html" class="code" title="function [tt2]=tt_reverse(tt,phd)">tt_reverse</a>(tt,3);
0056 
0057 <span class="keyword">return</span>
0058 <span class="keyword">end</span></pre></div>
<hr><address>Generated on Wed 08-Feb-2012 18:20:24 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
</body>
</html>